home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act4 / 00056.ls < prev    next >
Encoding:
Text File  |  1995-04-05  |  1.3 KB  |  48 lines

  1. on exitFrame
  2.   global bucketcol, level1, NumofCol, pal, kingcolor, mastercounter, origsprites, steplimit
  3.   if level1 = 1 then
  4.     set prefix to "pc1."
  5.     set offset to 0
  6.   else
  7.     set prefix to "pc2."
  8.     set offset to 10
  9.   end if
  10.   repeat with xxx = 38 to 37 + NumofCol
  11.     puppetSprite(xxx, 1)
  12.     if level1 = 1 then
  13.       set the castNum of sprite xxx to the number of cast (prefix & getAt(pal, xxx - 37))
  14.     end if
  15.     set the visible of sprite xxx to 1
  16.   end repeat
  17.   set kingcolor to getAt(pal, 1)
  18.   set steplimit to []
  19.   set origsprites to []
  20.   repeat with xxx = 1 to NumofCol
  21.     if level1 = 1 then
  22.       set mycancolor to getAt(pal, xxx)
  23.     else
  24.       set mycancolor to xxx
  25.     end if
  26.     add(steplimit, getAt(mastercounter, mycancolor + offset))
  27.     set myloch to the locH of sprite (xxx + 37)
  28.     set mylocv to the locV of sprite (xxx + 37)
  29.     add(origsprites, list(mycancolor, myloch, mylocv))
  30.   end repeat
  31.   set bucketcol to []
  32.   repeat with xxx = 1 to count(pal)
  33.     if level1 = 1 then
  34.       add(bucketcol, getAt(pal, xxx))
  35.       next repeat
  36.     end if
  37.     add(bucketcol, xxx)
  38.   end repeat
  39.   set crunch to pal
  40.   set pal to []
  41.   repeat with xxx = 1 to NumofCol
  42.     set sample to random(count(crunch))
  43.     add(pal, getAt(crunch, sample))
  44.     deleteAt(crunch, sample)
  45.   end repeat
  46.   puppetSound(0)
  47. end
  48.